﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Engine.GameClass
{
    public struct Experiens
    {
        public int nowLevelExp;
        public int nextLevelExp;
        public int expNeed { get{return nextLevelExp-nowLevelExp;}  }

    }
   
    public static class LevelTable
    {
        const byte MAXLEVEL = 255;
        private static int[] LevelExp=new int[MAXLEVEL];
         public static void InitTable()
    {
        LevelExp[0] = 0;
        for (int i = 1; i < 255; i++)
        {
            LevelExp[i] = i * 255 * 255;
        }
    }
        public static Experiens getExp(byte level)
        {
            if (level != MAXLEVEL)
            {
                return new Experiens() { nowLevelExp = LevelExp[level], nextLevelExp = LevelExp[level + 1] };
            }
            else
            {
                return new Experiens() { nowLevelExp = LevelExp[level], nextLevelExp = LevelExp[level] };
            }
            
        }
    }
}
